<template>
  <div class="bw-dom-tree">
    <template v-for="item in dataSource" :key="item.id">
      <BwDomNode
        :data="item"
        @select="onSelect"
        @hide="onNodeHide"
        @delete="onNodeRmove"
      />
    </template>
  </div>
</template>

<script lang="ts" setup>
import { useDomTree } from './util'
import BwDomNode from './domNode/index.vue'

const { dataSource, onSelect, onNodeRmove, onNodeHide } = useDomTree()
</script>

<style lang="less" scoped>
.bw-dom-tree {
  padding: 16px;
  font-size: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
}
</style>
